<template>
  <div class="packagedetail-dialog">
    <el-dialog :visible.sync="dialog" :before-close="handleClose" title="上传课程封面" width="1012px">
      <el-radio-group v-model="radio">
        <el-radio-button label="本地上传"/>
        <el-radio-button label="公共封面"/>
      </el-radio-group>
      <upload-main v-if="radio === '本地上传'" @openInner="innerDialog = true"/>
      <history-main v-if="radio === '公共封面'" />
      <inner-dialog :inner-visible="innerDialog" @closeInner="innerDialog = false"/>
    </el-dialog>
  </div>
</template>

<script>
import uploadMain from './upload'
import historyMain from './history'
import innerDialog from './innerupload'
export default {
  components: {
    uploadMain,
    historyMain,
    innerDialog
  },
  props: {
    visibleDialog: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      radio: '本地上传',
      innerDialog: false
    }
  },
  computed: {
    dialog() {
      return this.visibleDialog
    }
  },
  methods: {
    handleClose() {
      this.$emit('closeDialog')
    }
  }
}
</script>

<style lang="scss">
.packagedetail-dialog {
  .el-dialog {
    border-radius: 5px;
    .el-dialog__body {
      padding-top:10px;
    }
  }
}
</style>
